home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tpgrwndw.zip / DEMOWNDW.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-04  |  1KB  |  48 lines

  1. (*  A graphics Window unit designed for the Adventure System *)
  2. Program WndwDemo;
  3. uses Windows,Graph,Crt;
  4. var
  5.    CursorPrompt : string;
  6.    GrDriver,
  7.    GrMode   : integer;
  8.    ch       : char;
  9.    testSt   : string;
  10.    x,y      : integer;
  11.    lcv      : byte;
  12. Begin
  13.   CursorPrompt := '';
  14.   CursorPrompt := 'Enter Text';
  15.   grDriver := Detect;
  16.   InitGraph(grDriver,grMode,'');
  17.   if GrDriver = VGA then
  18.     SetGraphMode(VGAMed)
  19.    else if grDriver = EGA then
  20.     SetGraphMode(EGAHI);
  21.   ShowWndw(CursorWndw(CursorPrompt)); (* ShowWndw will close itself *)
  22.   ShowWndw('Hello There.  Once upon a time there was an evil ogre.  He lived'+
  23.             ' in a fortress and stole a beautiful maiden who he wished to wed.');
  24.   for lcv := 1 to 7 do
  25.    begin
  26.      x := Random(60)+2;
  27.      y := Random(30)+2;
  28.      Str(lcv,testSt);
  29.      testSt := 'This is window #'+testSt+'!'+#13+'Check it out!'+
  30.                 #13+'You can have up to 7'+#13+'windows at a time!'+#13;
  31.      Case Random(4)+1 of
  32.        1 : TestSt := TestSt + 'Wild!';
  33.        2 : TestSt := TestSt + 'Funcky!';
  34.        3 : TestSt := TestSt + 'Awesome!';
  35.        4 : TestSt := TestSt + 'Really cool!';
  36.      end;
  37.      OpenWndw(testSt,x,y,x+20,y+4);
  38.      ClearText;  (* Since no close window, must clear window text buffer *)
  39.    end;
  40.  
  41.   for lcv := 1 to 7 do
  42.    begin
  43.      ch := ReadKey;
  44.      CloseWndw;
  45.    end;
  46.  
  47.   CloseGraph;
  48. End.